import { PrismaClient } from '@prisma/client'
import { Random } from 'mockjs'
const prisma = new PrismaClient()

async function run() {
	for (let i = 0; i < 20; i++) {
		await prisma.user.create({
			data: {
				nickname: Random.cname(),
				username: Random.string(),
				password: Random.string(),
				email: `user${i + 1}@example.com`,
				mobile: '1' + ('' + Math.random()).substring(2, 12),
				App: {
					create: {
						title: Random.csentence(),
						content: Random.cparagraph(),
						preview: Random.image('480x300')
					}
				}
			}
		})
	}
}

run()
